package com.wangs.controller;

import com.wangs.dto.UserDTO;
import com.wangs.validated.CreateGroup;
import com.wangs.validated.UpdateGroup;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/users/")
public class UserController {

    @PostMapping("add")
    public ResponseEntity<String> createUser(@Validated(CreateGroup.class) @RequestBody UserDTO userDTO) {
        // 处理创建用户的逻辑
        return ResponseEntity.ok("用户创建成功");
    }

    @PostMapping("update")
    public ResponseEntity<String> updateUser(@Validated(UpdateGroup.class) @RequestBody UserDTO userDTO) {
        // 处理更新用户的逻辑
        return ResponseEntity.ok("用户更新成功");
    }
}
